box gadget: Fix allocation without baseline
authorMatthias Clasen <mclasen@redhat.com>
Sun, 7 Feb 2016 14:08:56 +0000 (15:08 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 7 Feb 2016 14:08:56 +0000 (15:08 +0100)
When we don't get a baseline passed in, we want to basically
center the children inside the allocation. There was an attempt
in the code to do 'internal baseline alignment', but it had the
side effect of moving the contents to the top when we don't get
a baseline passed in. Remove it for now, this needs some more
infrastructure to do properly.

https://bugzilla.gnome.org/show_bug.cgi?id=761363

gtk/gtkboxgadget.c

index 1adbcb6774cbdd9031a9800859ca9e3c4d4533f4..e16ddbd2fffb48bc82fd9c4f8aa8c09e1d20a669 100644 (file)
@@ -387,27 +387,6 @@ gtk_box_gadget_allocate (GtkCssGadget        *gadget,
     {
       gtk_box_gadget_distribute (GTK_BOX_GADGET (gadget), allocation->height, allocation->width, sizes);
 
-      if (baseline < 0)
-        {
-          for (i = 0; i < priv->children->len; i++)
-            {
-              GtkBoxGadgetChild *child = &g_array_index (priv->children, GtkBoxGadgetChild, i);
-
-              if (gtk_box_gadget_child_get_align (GTK_BOX_GADGET (gadget), child) == GTK_ALIGN_BASELINE)
-                {
-                  gint child_min, child_nat;
-                  gint child_baseline_min, child_baseline_nat;
-
-                  gtk_box_gadget_measure_child (child->object,
-                                                GTK_ORIENTATION_VERTICAL,
-                                                sizes[i].minimum_size,
-                                                &child_min, &child_nat,
-                                                &child_baseline_min, &child_baseline_nat);
-                  baseline = MAX (baseline, child_baseline_min);
-                }
-            }
-        }
-
       for (i = 0; i < priv->children->len; i++)
         {
           GtkBoxGadgetChild *child = &g_array_index (priv->children, GtkBoxGadgetChild, i);